package com.woniuxy.patrol.mapper;

import com.woniuxy.patrol.pojo.PatrolTaskRoute;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
* @author 13162
* @description 针对表【wcm_patrol_task_route(任务-路线关联表)】的数据库操作Mapper
* @createDate 2025-07-19 09:34:19
* @Entity com.woniuxy.patrol.pojo.PatrolTaskRoute
*/
public interface PatrolTaskRouteMapper extends BaseMapper<PatrolTaskRoute> {

    void batchInsert(List<PatrolTaskRoute> taskRoutes);
    // 按小时统计今日各状态的巡更路线数量
    @MapKey("hour")
    List<Map<String, Object>> selectTodayTrendByHour(
            @Param("startTime") LocalDateTime startTime,
            @Param("endTime") LocalDateTime endTime,
            @Param("communityId") Long communityId
    );
}




